package com.huawei.translate.persistence;

import com.huawei.translate.model.AccessToken;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AccessTokenRepository extends IRepository<AccessToken, String> {
    AccessToken findByAppSecret(String appSecret);

    @Cacheable("accessTokens")
    List<AccessToken> findByAppSecretAndSaltAndApplyTime(String appSecret, String salt, long applyTime);
}
